﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CuotaItemGrid.ascx.cs" 
Inherits="UILGestion.VentaAdmin.OrdenVenta.CuotaItemGrid" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 
  <%@ Register assembly="WebLib" namespace="WebLib" tagprefix="lib" %>

 <input id="internalID" type="hidden" runat="server" />
  <input id="idColeccionOrigen" type="hidden" runat="server" />
  <input id="idColeccionDestino" type="hidden" runat="server" />
  <input id="concepto" type="hidden" runat="server" />
    <asp:Panel ID="Panel1" runat="server" CssClass="Heading secTitle AreaHeading ms-crm-List-Header " >
               FRACCIONAMIENTO
                </asp:Panel>
  
   <asp:UpdatePanel ID="cabUPNL" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

   
    <table width="200px" style="background-color:White">
                   
                    <tr>
                        <td rowspan="10" valign="top"  Width="480px">
               
                                     <table>
                                         <tr>
                                             <td align="right" width="100px">
                                                 Fecha:</td>
                                             <td>
                                                
                                                             <asp:Label ID="fechaLBL" runat="server" Text="Label"></asp:Label>
                                             </td>
                                             <td>
                                                
                                                 Comentario:</td>
                                             <td rowspan="5" valign="top">
                                                
                                                 <asp:TextBox ID="comentarioTXT" runat="server" Height="70px" 
                                                     TextMode="MultiLine" Width="200px"></asp:TextBox>
                                             </td>
                                             <td rowspan="6" width="300px" valign="top" align="right">
                                             
                                             <asp:UpdatePanel ID="estadisticaUPNL" runat="server"  UpdateMode="Conditional">
<ContentTemplate>
                                             <table width="200px"   class="PanelTotales" >
                                             
                    <tr>
                        <td align="right"  width="100px">
                            Total Saldo:</td>
                        <td align="right">
                            <asp:Label ID="totalSaldoLBL" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr >
                        <td align="right"  width="100px">
                            Total en Cuota:</td>
                        <td align="right">
                            <asp:Label ID="totalCuotaLBL" runat="server"></asp:Label>
                        </td>
                    </tr>
                                             
                                             </table>
                                             
                                             </ContentTemplate>
</asp:UpdatePanel>
                                             
                                             </td>
                                         </tr>
                                         <tr>
                                             <td align="right" valign="top" width="100px">
                                                 UI:</td>
                                             <td>
                                                
                                                 <asp:DropDownList ID="UIDDL" runat="server" Width="300px"  AutoPostBack="true"
                                                     onselectedindexchanged="UIDDL_SelectedIndexChanged">
                                                 </asp:DropDownList>
                                                         </td>
                                             <td>
                                                 &nbsp;</td>
                                             <td>
                                                 &nbsp;</td>
                                         </tr>
                           
                                         <tr>
                                             <td align="right" width="100px">
                                                 Tipo UI:</td>
                                             <td>
                                                 <asp:TextBox ID="tipoUITXT" runat="server" Enabled="false"></asp:TextBox>
                                                 <lib:Input ID="idTipoUITXT" runat="server" ReadOnly="true" Width="0px" />
                                             </td>
                                             <td>
                                                 &nbsp;</td>
                                             <td>
                                                 &nbsp;</td>
                                         </tr>
                           
                                         <tr>
                                             <td align="right" width="100px">
                                                 Moneda:</td>
                                             <td>
                                                 <asp:DropDownList ID="monedaDDL" runat="server" Width="200px" Enabled="false">
                                                 </asp:DropDownList>
                                             </td>
                                             <td>
                                                 &nbsp;</td>
                                             <td>
                                                 &nbsp;</td>
                                         </tr>
                           
                                                            
                                         </table>
               
                        </td>
                    </tr>
                  
               

                </table>
            
            </ContentTemplate>
<Triggers >
<asp:AsyncPostBackTrigger ControlID="UIDDL" />
</Triggers>
</asp:UpdatePanel>




  
<asp:TabContainer ID="TabContainer1" runat="server">

<asp:TabPanel ID="Saldos" runat="server"  HeaderText="Saldos Por Pagar">
<ContentTemplate>

 
                       
    <asp:UpdatePanel ID="orgienUPNL" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

 <asp:GridView ID="origenGridView" runat="server" DataKeyNames="idInternal"
   
    ShowHeaderWhenEmpty="True" SkinID="GridView" >

                                    <Columns>
                             
                                     <asp:TemplateField HeaderText="CODIGO">
                                         <ItemTemplate>
                                             <asp:Label ID="descripcionLabel" runat="server" Text='<%# Eval("numDocumento")%>' 
                                                 Width="70px"></asp:Label>
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <asp:Label ID="descripcionEditTextBox" runat="server" BackColor="Transparent"   
                                             Text='<%# Eval("numDocumento")%>'  />
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             
                                         </FooterTemplate>
                                         <HeaderStyle Width="70px" />
                                     </asp:TemplateField>
                                     <asp:TemplateField HeaderText="DOCUMENTO">
                                         <EditItemTemplate>
                                             <lib:Input ID="documentoEditTextBox" runat="server"  BackColor="Transparent" Text='<%# Eval("concepto")%>' Width="100%" />
                                         </EditItemTemplate>
                                         
                                         
                                         <ItemTemplate>
                                             <asp:Label ID="conceptoLabel" runat="server" 
                                                 Text='<%# Eval("concepto")%>'></asp:Label>
                                         </ItemTemplate>
                                         <FooterTemplate>
                                         <lib:Input ID="conceptoEditTextBox" runat="server"
                                                 Width="100%"></lib:Input>
                                            
                                           
                                         </FooterTemplate>
                                         <ControlStyle Width="350px" />
                                     </asp:TemplateField>

                                       <asp:TemplateField HeaderText="FEC. VENCIMIENTO">
                                         <EditItemTemplate>
                                             <lib:Input ID="fechaVencimientoEditTXT" runat="server"  Text='<%# Eval("fechaVencimientoStr")%>' Width="100%" />
                                         </EditItemTemplate>
                                         <ItemTemplate>
                                             <asp:Label ID="fechaVencimientoLabel" runat="server" Text='<%# Eval("fechaVencimientoStr")%>'></asp:Label>
                                         </ItemTemplate>
                                         <FooterTemplate>
                                         <table>
                                         <tr>
                                         <td Width="85px"><lib:Input ID="fechaVencimientoEditTXT" runat="server" Width="100%"></lib:Input>
                                         </td>
                                         <td>
                                                 <asp:ImageButton ID="ImageButton3" runat="Server" 
                                                     AlternateText="Click aqui para mostrar calendario" 
                                                     ImageUrl="~/Images/month.gif" Width="16px" />
                                                 <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                     PopupButtonID="ImageButton3" TargetControlID="fechaVencimientoEditTXT">
                                                   </asp:CalendarExtender> 
                                         </td>
                                         </tr>
                                         
                                         </table>
                                         
                                            
                                           
                                         </FooterTemplate>
                                           <ControlStyle Width="100px" />
                                     </asp:TemplateField>



                                     <asp:TemplateField 
                                         HeaderText="TOTAL">
                                         <ItemTemplate>
                                             <asp:Label ID="totalLabel" runat="server" Text='<%# Eval("total")%>' />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <lib:Input ID="totalTextBox" runat="server"  
                                                 DataType="Double"  Text='<%# Eval("total")%>' Width="100%"></lib:Input>
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="totalTextBox" runat="server" BackColor="Transparent" 
                                                  DataType="Double"  Width="120px"></lib:Input>
                                         </FooterTemplate>
                                         <ControlStyle Width="120px" />
                                         <HeaderStyle Width="120px" />
                                         <ItemStyle HorizontalAlign="Right" />
                                     </asp:TemplateField>
                                          
                           <asp:TemplateField>
                                         <FooterTemplate>
                                             <%--<asp:Button ID="addProvAdd" runat="server" OnClick="AddItem" Text="Añadir" />--%>
                                         </FooterTemplate>
                                         <ItemTemplate>
                                             <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                                 CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                                 OnClick="DeleteOrigenItem" 
                                                 OnClientClick="return confirm('Usted quiere eliminar?')" />
                                         </ItemTemplate>
                                     </asp:TemplateField>

                                   
                                 </Columns>
 </asp:GridView>
   
</ContentTemplate>
</asp:UpdatePanel>


</ContentTemplate>

</asp:TabPanel>





<asp:TabPanel ID="nuevoCuotas"  runat="server"  HeaderText="Nuevo Fraccionamiento" >
<ContentTemplate>
  <asp:Panel ID="Panel3" runat="server" Height="200px" ScrollBars="Vertical" BackColor="White" 
                       BorderColor="LightSteelBlue" BorderStyle="Solid" BorderWidth="1px"   >
 <asp:UpdatePanel ID="nuevaCuotaFinUPNL" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

  
   <asp:GridView ID="itemGridView" runat="server"
    DataKeyNames="idInternal" ShowFooter="true"
    onrowcancelingedit="CancelItem" 
    onrowediting="EditItem" 
    OnRowUpdating="UpdateItem" 
    ShowHeaderWhenEmpty="true" SkinID="GridView" >
                                 <Columns>
                             
                                     <asp:TemplateField HeaderStyle-Width="70px" HeaderText="CODIGO">
                                         <ItemTemplate>
                                             <asp:Label ID="numdocumentoLabel" runat="server" Text='<%# Eval("numDocumento")%>' 
                                                 Width="70px"></asp:Label>
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <asp:Label ID="numdocumentoEditTextBox" runat="server" BackColor="Transparent"   
                                             Text='<%# Eval("numDocumento")%>'  />
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             
                                         </FooterTemplate>
                                     </asp:TemplateField>
                                     <asp:TemplateField ControlStyle-Width="350px" HeaderText="DOCUMENTO">
                                         <EditItemTemplate>
                                             <lib:Input ID="documentoEditTextBox" runat="server"  ReadOnly="true" Text='<%# Eval("concepto")%>' Width="100%" />
                                         </EditItemTemplate>
                                         
                                         <ItemTemplate>
                                             <asp:Label ID="descripcionLabel" runat="server" 
                                                 Text='<%# Eval("concepto")%>'></asp:Label>
                                         </ItemTemplate>
                                         <FooterTemplate>
                                             <asp:DropDownList ID="conceptoDDL" runat="server" Width="200px">
                                             </asp:DropDownList>
                                         </FooterTemplate>

                                     </asp:TemplateField>

                                       <asp:TemplateField ControlStyle-Width="100px" HeaderText="FEC. VENCIMIENTO">
                                         <EditItemTemplate>
                                            <table>
                                         <tr>
                                         <td >
                                         <lib:Input ID="fechaVencimientoEditTXT" runat="server" Width="100%" 
                                         Text='<%# Eval("fechaVencimientoStr")%>'></lib:Input>
                                         </td>
                                         <td>
                                                 <asp:ImageButton ID="ImageButton4" runat="Server" 
                                                     AlternateText="Click aqui para mostrar calendario" 
                                                     ImageUrl="~/Images/month.gif"  />
                                                 <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                     PopupButtonID="ImageButton4" TargetControlID="fechaVencimientoEditTXT">
                                                   </asp:CalendarExtender> 
                                         </td>
                                         </tr>
                                         
                                         </table>


                                         </EditItemTemplate>
                                         <ItemTemplate>
                                       


                                             <asp:Label ID="fechaVencimientoLabel" runat="server" Text='<%# Eval("fechaVencimientoStr")%>'></asp:Label>
                                         </ItemTemplate>
                                         <FooterTemplate>
                                         <table>
                                         <tr>
                                         <td ><lib:Input ID="fechaVencimientoEditTXT" runat="server" Width="100%"></lib:Input>
                                         </td>
                                         <td>
                                                 <asp:ImageButton ID="ImageButton3" runat="Server" 
                                                     AlternateText="Click aqui para mostrar calendario" 
                                                     ImageUrl="~/Images/month.gif" Width="16px" />
                                                 <asp:CalendarExtender ID="CalendarExtender2" runat="server" 
                                                     PopupButtonID="ImageButton3" TargetControlID="fechaVencimientoEditTXT">
                                                   </asp:CalendarExtender> 
                                         </td>
                                         </tr>
                                         
                                         </table>
                                         
                                            
                                           
                                         </FooterTemplate>
                                     </asp:TemplateField>



                                     <asp:TemplateField ControlStyle-Width="120px" HeaderStyle-Width="120px"
                                       HeaderStyle-HorizontalAlign="Right"
                                         HeaderText="TOTAL" ItemStyle-HorizontalAlign="Right">
                                         <ItemTemplate>
                                             <asp:Label ID="totalLabel" runat="server" Text='<%# Eval("total")%>' />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <lib:Input ID="totalTextBox" runat="server"  
                                                 DataType="Double"  Text='<%# Eval("total")%>' Width="100%"></lib:Input>
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="totalTextBox" runat="server" 
                                                  DataType="Double"  Width="120px"></lib:Input>
                                         </FooterTemplate>
                                     </asp:TemplateField>
                                          
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                            EditImageUrl="~/Images/edit.gif" ShowEditButton="true" 
                            UpdateImageUrl="~/Images/update.gif" />
                         

                           <asp:TemplateField>
                                         <FooterTemplate>
                                             <asp:Button ID="addProvAdd" runat="server" OnClick="AddItem" Text="Añadir" />
                                             </FooterTemplate>
                                         <ItemTemplate>
                                             <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                                 CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                                 OnClick="DeleteItem" 
                                                 OnClientClick="return confirm('Usted quiere eliminar?')" />
                                         </ItemTemplate>
                                     </asp:TemplateField>

                                   
                                 </Columns>
                             </asp:GridView>
  
</ContentTemplate>
<Triggers >
<asp:AsyncPostBackTrigger ControlID="UIDDL" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>

</ContentTemplate>

</asp:TabPanel>





</asp:TabContainer>

